Blaze  3.6
DMatDeclUppExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATDECLUPPEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATDECLUPPEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
45 #include <blaze/math/Aliases.h>
51 #include <blaze/math/Exception.h>
65 #include <blaze/util/Assert.h>
66 #include <blaze/util/DisableIf.h>
67 #include <blaze/util/EnableIf.h>
70 #include <blaze/util/InvalidType.h>
71 #include <blaze/util/mpl/If.h>
72 #include <blaze/util/Types.h>
74 
75 
76 namespace blaze {
77 
78 //=================================================================================================
79 //
80 // CLASS DMATDECLUPPEXPR
81 //
82 //=================================================================================================
83 
84 //*************************************************************************************************
91 template< typename MT // Type of the dense matrix
92  , bool SO > // Storage order
94  : public DeclUppExpr< DenseMatrix< DMatDeclUppExpr<MT,SO>, SO > >
95  , public Declaration<MT>
96 {
97  private:
98  //**Type definitions****************************************************************************
99  using RT = ResultType_t<MT>;
100 
102  BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT( GetConstIterator, ConstIterator, INVALID_TYPE );
103  //**********************************************************************************************
104 
105  //**Serial evaluation strategy******************************************************************
107 
113  static constexpr bool useAssign = RequiresEvaluation_v<MT>;
114 
116  template< typename MT2 >
118  static constexpr bool UseAssign_v = useAssign;
120  //**********************************************************************************************
121 
122  //**Parallel evaluation strategy****************************************************************
124 
130  template< typename MT2 >
131  static constexpr bool UseSMPAssign_v = ( MT2::smpAssignable && useAssign );
133  //**********************************************************************************************
134 
135  public:
136  //**Type definitions****************************************************************************
144 
147 
149  using ConstIterator = GetConstIterator_t<MT>;
150 
152  using Operand = If_t< IsExpression_v<MT>, const MT, const MT& >;
153  //**********************************************************************************************
154 
155  //**Compilation flags***************************************************************************
157  static constexpr bool simdEnabled = MT::simdEnabled;
158 
160  static constexpr bool smpAssignable = MT::smpAssignable;
161  //**********************************************************************************************
162 
163  //**SIMD properties*****************************************************************************
165  static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
166  //**********************************************************************************************
167 
168  //**Constructor*********************************************************************************
173  explicit inline DMatDeclUppExpr( const MT& dm ) noexcept
174  : dm_( dm ) // Dense matrix of the declupp expression
175  {
176  BLAZE_INTERNAL_ASSERT( isSquare( ~dm ), "Non-square matrix detected" );
177  }
178  //**********************************************************************************************
179 
180  //**Access operator*****************************************************************************
187  inline ReturnType operator()( size_t i, size_t j ) const {
188  BLAZE_INTERNAL_ASSERT( i < dm_.rows() , "Invalid row access index" );
189  BLAZE_INTERNAL_ASSERT( j < dm_.columns(), "Invalid column access index" );
190  return dm_(i,j);
191  }
192  //**********************************************************************************************
193 
194  //**At function*********************************************************************************
202  inline ReturnType at( size_t i, size_t j ) const {
203  if( i >= dm_.rows() ) {
204  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
205  }
206  if( j >= dm_.columns() ) {
207  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
208  }
209  return (*this)(i,j);
210  }
211  //**********************************************************************************************
212 
213  //**Load function*******************************************************************************
220  BLAZE_ALWAYS_INLINE auto load( size_t i, size_t j ) const noexcept {
221  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
222  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
223  BLAZE_INTERNAL_ASSERT( !SO || ( i % SIMDSIZE == 0UL ), "Invalid row access index" );
224  BLAZE_INTERNAL_ASSERT( SO || ( j % SIMDSIZE == 0UL ), "Invalid column access index" );
225  return dm_.load(i,j);
226  }
227  //**********************************************************************************************
228 
229  //**Low-level data access***********************************************************************
234  inline const ElementType* data() const noexcept {
235  return dm_.data();
236  }
237  //**********************************************************************************************
238 
239  //**Begin function******************************************************************************
245  inline ConstIterator begin( size_t i ) const {
246  return ConstIterator( dm_.begin(i) );
247  }
248  //**********************************************************************************************
249 
250  //**End function********************************************************************************
256  inline ConstIterator end( size_t i ) const {
257  return ConstIterator( dm_.end(i) );
258  }
259  //**********************************************************************************************
260 
261  //**Rows function*******************************************************************************
266  inline size_t rows() const noexcept {
267  return dm_.rows();
268  }
269  //**********************************************************************************************
270 
271  //**Columns function****************************************************************************
276  inline size_t columns() const noexcept {
277  return dm_.columns();
278  }
279  //**********************************************************************************************
280 
281  //**Operand access******************************************************************************
286  inline Operand operand() const noexcept {
287  return dm_;
288  }
289  //**********************************************************************************************
290 
291  //**********************************************************************************************
297  template< typename T >
298  inline bool canAlias( const T* alias ) const noexcept {
299  return dm_.canAlias( alias );
300  }
301  //**********************************************************************************************
302 
303  //**********************************************************************************************
309  template< typename T >
310  inline bool isAliased( const T* alias ) const noexcept {
311  return dm_.isAliased( alias );
312  }
313  //**********************************************************************************************
314 
315  //**********************************************************************************************
320  inline bool isAligned() const noexcept {
321  return dm_.isAligned();
322  }
323  //**********************************************************************************************
324 
325  //**********************************************************************************************
330  inline bool canSMPAssign() const noexcept {
331  return dm_.canSMPAssign();
332  }
333  //**********************************************************************************************
334 
335  private:
336  //**Member variables****************************************************************************
338  //**********************************************************************************************
339 
340  //**Assignment to dense matrices****************************************************************
352  template< typename MT2 // Type of the target dense matrix
353  , bool SO2 > // Storage order of the target dense matrix
354  friend inline auto assign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
356  {
358 
359  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
360  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
361 
362  assign( ~lhs, rhs.dm_ );
363  }
365  //**********************************************************************************************
366 
367  //**Assignment to sparse matrices***************************************************************
379  template< typename MT2 // Type of the target sparse matrix
380  , bool SO2 > // Storage order of the target dense matrix
381  friend inline auto assign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
383  {
385 
386  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
387  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
388 
389  assign( ~lhs, rhs.dm_ );
390  }
392  //**********************************************************************************************
393 
394  //**Addition assignment to dense matrices*******************************************************
406  template< typename MT2 // Type of the target dense matrix
407  , bool SO2 > // Storage order of the target dense matrix
408  friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
409  -> EnableIf_t< UseAssign_v<MT2> >
410  {
412 
413  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
414  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
415 
416  addAssign( ~lhs, rhs.dm_ );
417  }
419  //**********************************************************************************************
420 
421  //**Addition assignment to sparse matrices******************************************************
433  template< typename MT2 // Type of the target sparse matrix
434  , bool SO2 > // Storage order of the target dense matrix
435  friend inline auto addAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
436  -> EnableIf_t< UseAssign_v<MT2> >
437  {
439 
440  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
441  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
442 
443  addAssign( ~lhs, rhs.dm_ );
444  }
446  //**********************************************************************************************
447 
448  //**Subtraction assignment to dense matrices****************************************************
460  template< typename MT2 // Type of the target dense matrix
461  , bool SO2 > // Storage order of the target dense matrix
462  friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
463  -> EnableIf_t< UseAssign_v<MT2> >
464  {
466 
467  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
468  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
469 
470  subAssign( ~lhs, rhs.dm_ );
471  }
473  //**********************************************************************************************
474 
475  //**Subtraction assignment to sparse matrices***************************************************
487  template< typename MT2 // Type of the target sparse matrix
488  , bool SO2 > // Storage order of the target dense matrix
489  friend inline auto subAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
490  -> EnableIf_t< UseAssign_v<MT2> >
491  {
493 
494  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
495  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
496 
497  subAssign( ~lhs, rhs.dm_ );
498  }
500  //**********************************************************************************************
501 
502  //**Schur product assignment to dense matrices**************************************************
514  template< typename MT2 // Type of the target dense matrix
515  , bool SO2 > // Storage order of the target dense matrix
516  friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
517  -> EnableIf_t< UseAssign_v<MT2> >
518  {
520 
521  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
522  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
523 
524  schurAssign( ~lhs, rhs.dm_ );
525  }
527  //**********************************************************************************************
528 
529  //**Schur product assignment to sparse matrices*************************************************
541  template< typename MT2 // Type of the target sparse matrix
542  , bool SO2 > // Storage order of the target dense matrix
543  friend inline auto schurAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
544  -> EnableIf_t< UseAssign_v<MT2> >
545  {
547 
548  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
549  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
550 
551  schurAssign( ~lhs, rhs.dm_ );
552  }
554  //**********************************************************************************************
555 
556  //**Multiplication assignment to dense matrices*************************************************
568  template< typename MT2 // Type of the target dense matrix
569  , bool SO2 > // Storage order of the target dense matrix
570  friend inline auto multAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
571  -> EnableIf_t< UseAssign_v<MT2> >
572  {
574 
575  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
576  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
577 
578  multAssign( ~lhs, rhs.dm_ );
579  }
581  //**********************************************************************************************
582 
583  //**Multiplication assignment to sparse matrices************************************************
595  template< typename MT2 // Type of the target sparse matrix
596  , bool SO2 > // Storage order of the target dense matrix
597  friend inline auto multAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
598  -> EnableIf_t< UseAssign_v<MT2> >
599  {
601 
602  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
603  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
604 
605  multAssign( ~lhs, rhs.dm_ );
606  }
608  //**********************************************************************************************
609 
610  //**SMP assignment to dense matrices************************************************************
622  template< typename MT2 // Type of the target dense matrix
623  , bool SO2 > // Storage order of the target dense matrix
624  friend inline auto smpAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
625  -> EnableIf_t< UseSMPAssign_v<MT2> >
626  {
628 
629  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
630  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
631 
632  smpAssign( ~lhs, rhs.dm_ );
633  }
635  //**********************************************************************************************
636 
637  //**SMP assignment to sparse matrices***********************************************************
649  template< typename MT2 // Type of the target sparse matrix
650  , bool SO2 > // Storage order of the target dense matrix
651  friend inline auto smpAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
652  -> EnableIf_t< UseSMPAssign_v<MT2> >
653  {
655 
656  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
657  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
658 
659  smpAssign( ~lhs, rhs.dm_ );
660  }
662  //**********************************************************************************************
663 
664  //**SMP addition assignment to dense matrices***************************************************
676  template< typename MT2 // Type of the target dense matrix
677  , bool SO2 > // Storage order of the target dense matrix
678  friend inline auto smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
679  -> EnableIf_t< UseSMPAssign_v<MT2> >
680  {
682 
683  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
684  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
685 
686  smpAddAssign( ~lhs, rhs.dm_ );
687  }
689  //**********************************************************************************************
690 
691  //**SMP addition assignment to sparse matrices**************************************************
703  template< typename MT2 // Type of the target sparse matrix
704  , bool SO2 > // Storage order of the target dense matrix
705  friend inline auto smpAddAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
706  -> EnableIf_t< UseSMPAssign_v<MT2> >
707  {
709 
710  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
711  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
712 
713  smpAddAssign( ~lhs, rhs.dm_ );
714  }
716  //**********************************************************************************************
717 
718  //**SMP subtraction 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 auto smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
733  -> EnableIf_t< UseSMPAssign_v<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  smpSubAssign( ~lhs, rhs.dm_ );
741  }
743  //**********************************************************************************************
744 
745  //**SMP subtraction assignment to sparse matrices***********************************************
757  template< typename MT2 // Type of the target sparse matrix
758  , bool SO2 > // Storage order of the target dense matrix
759  friend inline auto smpSubAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
760  -> EnableIf_t< UseSMPAssign_v<MT2> >
761  {
763 
764  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
765  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
766 
767  smpSubAssign( ~lhs, rhs.dm_ );
768  }
770  //**********************************************************************************************
771 
772  //**SMP Schur product assignment to dense matrices**********************************************
784  template< typename MT2 // Type of the target dense matrix
785  , bool SO2 > // Storage order of the target dense matrix
786  friend inline auto smpSchurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
787  -> EnableIf_t< UseSMPAssign_v<MT2> >
788  {
790 
791  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
792  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
793 
794  smpSchurAssign( ~lhs, rhs.dm_ );
795  }
797  //**********************************************************************************************
798 
799  //**SMP Schur product assignment to sparse matrices*********************************************
811  template< typename MT2 // Type of the target sparse matrix
812  , bool SO2 > // Storage order of the target dense matrix
813  friend inline auto smpSchurAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
814  -> EnableIf_t< UseSMPAssign_v<MT2> >
815  {
817 
818  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
819  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
820 
821  smpSchurAssign( ~lhs, rhs.dm_ );
822  }
824  //**********************************************************************************************
825 
826  //**SMP multiplication assignment to dense matrices*********************************************
839  template< typename MT2 // Type of the target dense matrix
840  , bool SO2 > // Storage order of the target dense matrix
841  friend inline auto smpMultAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
842  -> EnableIf_t< UseSMPAssign_v<MT2> >
843  {
845 
846  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
847  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
848 
849  smpMultAssign( ~lhs, rhs.dm_ );
850  }
852  //**********************************************************************************************
853 
854  //**SMP multiplication assignment to sparse matrices********************************************
867  template< typename MT2 // Type of the target sparse matrix
868  , bool SO2 > // Storage order of the target dense matrix
869  friend inline auto smpMultAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclUppExpr& rhs )
870  -> EnableIf_t< UseSMPAssign_v<MT2> >
871  {
873 
874  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
875  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
876 
877  smpMultAssign( ~lhs, rhs.dm_ );
878  }
880  //**********************************************************************************************
881 
882  //**Compile time checks*************************************************************************
890  //**********************************************************************************************
891 };
892 //*************************************************************************************************
893 
894 
895 
896 
897 //=================================================================================================
898 //
899 // GLOBAL FUNCTIONS
900 //
901 //=================================================================================================
902 
903 //*************************************************************************************************
914 template< typename MT // Type of the dense matrix
915  , bool SO // Storage order
916  , DisableIf_t< IsUpper_v<MT> || IsUniLower_v<MT> >* = nullptr >
917 inline const DMatDeclUppExpr<MT,SO> declupp_backend( const DenseMatrix<MT,SO>& dm )
918 {
920 
921  BLAZE_INTERNAL_ASSERT( isSquare( ~dm ), "Non-square matrix detected" );
922 
923  return DMatDeclUppExpr<MT,SO>( ~dm );
924 }
926 //*************************************************************************************************
927 
928 
929 //*************************************************************************************************
940 template< typename MT // Type of the dense matrix
941  , bool SO // Storage order
942  , EnableIf_t< !IsUpper_v<MT> && IsUniLower_v<MT> >* = nullptr >
943 inline const IdentityMatrix<ElementType_t<MT>,SO> declupp_backend( const DenseMatrix<MT,SO>& dm )
944 {
946 
947  BLAZE_INTERNAL_ASSERT( isSquare( ~dm ), "Non-square matrix detected" );
948 
949  return IdentityMatrix<ElementType_t<MT>,SO>( (~dm).rows() );
950 }
952 //*************************************************************************************************
953 
954 
955 //*************************************************************************************************
966 template< typename MT // Type of the dense matrix
967  , bool SO // Storage order
968  , EnableIf_t< IsUpper_v<MT> >* = nullptr >
969 inline const MT& declupp_backend( const DenseMatrix<MT,SO>& dm )
970 {
972 
973  BLAZE_INTERNAL_ASSERT( isSquare( ~dm ), "Non-square matrix detected" );
974 
975  return ~dm;
976 }
978 //*************************************************************************************************
979 
980 
981 //*************************************************************************************************
999 template< typename MT // Type of the dense matrix
1000  , bool SO > // Storage order
1001 inline decltype(auto) declupp( const DenseMatrix<MT,SO>& dm )
1002 {
1004 
1005  if( !isSquare( ~dm ) ) {
1006  BLAZE_THROW_INVALID_ARGUMENT( "Invalid upper matrix specification" );
1007  }
1008 
1009  return declupp_backend( ~dm );
1010 }
1011 //*************************************************************************************************
1012 
1013 
1014 
1015 
1016 //=================================================================================================
1017 //
1018 // GLOBAL RESTRUCTURING FUNCTIONS
1019 //
1020 //=================================================================================================
1021 
1022 //*************************************************************************************************
1036 template< typename MT // Type of the left-hand side dense matrix
1037  , typename ST // Type of the right-hand side scalar value
1038  , bool SO // Storage order
1039  , DisableIf_t< IsUpper_v<MT> >* = nullptr >
1040 inline decltype(auto) declupp( const DMatScalarMultExpr<MT,ST,SO>& dm )
1041 {
1043 
1044  if( !isSquare( ~dm ) ) {
1045  BLAZE_THROW_INVALID_ARGUMENT( "Invalid upper matrix specification" );
1046  }
1047 
1048  return declupp( dm.leftOperand() ) * dm.rightOperand();
1049 }
1051 //*************************************************************************************************
1052 
1053 
1054 
1055 
1056 //=================================================================================================
1057 //
1058 // HASCONSTDATAACCESS SPECIALIZATIONS
1059 //
1060 //=================================================================================================
1061 
1062 //*************************************************************************************************
1064 template< typename MT, bool SO >
1065 struct HasConstDataAccess< DMatDeclUppExpr<MT,SO> >
1066  : public HasConstDataAccess<MT>
1067 {};
1069 //*************************************************************************************************
1070 
1071 
1072 
1073 
1074 //=================================================================================================
1075 //
1076 // ISALIGNED SPECIALIZATIONS
1077 //
1078 //=================================================================================================
1079 
1080 //*************************************************************************************************
1082 template< typename MT, bool SO >
1083 struct IsAligned< DMatDeclUppExpr<MT,SO> >
1084  : public IsAligned<MT>
1085 {};
1087 //*************************************************************************************************
1088 
1089 
1090 
1091 
1092 //=================================================================================================
1093 //
1094 // ISUPPER SPECIALIZATIONS
1095 //
1096 //=================================================================================================
1097 
1098 //*************************************************************************************************
1100 template< typename MT, bool SO >
1101 struct IsUpper< DMatDeclUppExpr<MT,SO> >
1102  : public TrueType
1103 {};
1105 //*************************************************************************************************
1106 
1107 } // namespace blaze
1108 
1109 #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.
Header file for basic type definitions.
Header file for all forward declarations for sparse vectors and matrices.
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias template for the If class template.The If_t alias template provides a convenient shor...
Definition: If.h:109
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatDeclUppExpr.h:220
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatDeclUppExpr.h:187
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
#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
#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
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1001
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatDeclUppExpr.h:202
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatDeclUppExpr.h:298
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: IntegralConstant.h:132
Constraint on the data type.
Header file for the RequiresEvaluation type trait.
const ElementType * data() const noexcept
Low-level data access to the matrix elements.
Definition: DMatDeclUppExpr.h:234
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.The ReturnType_t alias declaration provides ...
Definition: Aliases.h:410
Header file for the SIMD trait.
Header file for the IsUniLower type trait.
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatDeclUppExpr.h:320
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes....
Definition: DenseMatrix.h:81
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes....
Definition: Forward.h:145
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
ElementType_t< MT > ElementType
Resulting element type.
Definition: DMatDeclUppExpr.h:142
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: DMatDeclUppExpr.h:143
Constraint on the data type.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the upper declaration expression.
Definition: DMatDeclUppExpr.h:113
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DMatDeclUppExpr.h:165
Header file for the DisableIf class template.
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.
#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 DenseMatrix base class.
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatDeclUppExpr.h:157
Header file for the GetMemberType type trait.
Header file for the IsAligned type trait.
BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT(GetConstIterator, ConstIterator, INVALID_TYPE)
Definition of the GetConstIterator 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:83
Operand operand() const noexcept
Returns the dense matrix operand.
Definition: DMatDeclUppExpr.h:286
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DMatDeclUppExpr.h:160
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type,...
Definition: Upper.h:81
DMatDeclUppExpr(const MT &dm) noexcept
Constructor for the DMatDeclUppExpr class.
Definition: DMatDeclUppExpr.h:173
If_t< RequiresEvaluation_v< MT >, const ResultType, const DMatDeclUppExpr & > CompositeType
Data type for composite expression templates.
Definition: DMatDeclUppExpr.h:146
Header file for the EnableIf class template.
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.The OppositeType_t alias declaration provi...
Definition: Aliases.h:270
Operand dm_
Dense matrix of the declupp expression.
Definition: DMatDeclUppExpr.h:337
Header file for the HasConstDataAccess type trait.
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite data type of the dense matrix expression.
Definition: DMatDeclUppExpr.h:152
Header file for the Declaration base class.
GetConstIterator_t< MT > ConstIterator
Iterator over the elements of the dense matrix.
Definition: DMatDeclUppExpr.h:149
Header file for the declupp trait.
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatDeclUppExpr.h:141
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
Header file for run time assertion macros.
Utility type for generic codes.
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
Constraint on the data type.
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:295
#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
Header file for all forward declarations for expression class templates.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNILOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower unitriangular matrix type,...
Definition: UniLower.h:81
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
auto smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:194
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatDeclUppExpr.h:245
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatDeclUppExpr.h:310
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatDeclUppExpr.h:276
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
Expression object for the explicit upper declaration of dense matrices.The DMatDeclUppExpr class repr...
Definition: DMatDeclUppExpr.h:93
Header file for the DeclUppExpr base class.
Header file for the IntegralConstant class template.
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatDeclUppExpr.h:256
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatDeclUppExpr.h:330
DeclUppTrait_t< RT > ResultType
Result type for expression template evaluations.
Definition: DMatDeclUppExpr.h:139
Header file for the IsUpper type trait.
Constraint on the data type.
Header file for the implementation of the base template of the UpperMatrix.
typename DeclUppTrait< MT >::Type DeclUppTrait_t
Auxiliary alias declaration for the DeclUppTrait type trait.The DeclUppTrait_t alias declaration prov...
Definition: DeclUppTrait.h:160
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatDeclUppExpr.h:266
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatDeclUppExpr.h:140
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
Definition: Assert.h:101
ResultType_t< MT > RT
Result type of the dense matrix expression.
Definition: DMatDeclUppExpr.h:99
auto smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector.
Definition: DenseVector.h:191
Base class for all declupp expression templates.The DeclUppExpr class serves as a tag for all express...
Definition: DeclUppExpr.h:66
Header file for the IsExpression type trait class.
Header file for the function trace functionality.